﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using DataAccess;

namespace Bussiness
{
    public class ProductManager
    {
        private ProductData data;
        public ProductManager()
        {
            data = new ProductData();
        }

        public IEnumerable<Product> AllProduct()
        {
            return data.AllProduct();
        }

        public IEnumerable<Product> SeachrProductByName(string name)
        {
            return data.SearchProductByName(name);
        }

        public IEnumerable<Product> SearchProductByPrice(int bPrice, int ePrice)
        {
            return data.SearchProductByPrice(bPrice, ePrice);
        }

        public IEnumerable<Product> GetProductByCategory(int cid)
        {
            return data.getProductByCategory(cid);
        }

        public IEnumerable<Product> GetProductBySupplier(int sid)
        {
            return data.getProductBySupplier(sid);    
        }

        public IEnumerable<Product> SearchProductByQuickSearch(string sProduct)
        {
            return data.SearchProductByQuickSearch(sProduct);
        }

        public void SortProductByName(bool isDesending)
        {
            
        }

        public Product GetProductById(int id)
        {
            return data.GetProductById(id);
        }

        public bool AddNewProduct(Product pro)
        {
            return data.AddNewProduct(pro);
        }

        public void DeleteProduct(int id)
        {
            data.DeleteProductById(id);
        }

        public void EditProduct(Product pro)
        {
            data.EditProduct(pro);
        }






    }
}
